import request from "@/utils/request";
import { R, page, PageQuery, emptyPageInfo } from "@/api/common/type";

import {GiftResponse,Gift} from '@/api/gifts/type'

enum API {
    GIFT_PAGE_URL = "/gift/gifts",
    GIFT_ONE_URL = "/gift/one",
    GIFT_ADD_URL = "/gift/add",
    GIFT_UPDATE_URL = "/gift/update",
    GIFT_DEL_URL = "/gift/delete",

}
 
//获取直播间的分页数据
export const reqGiftsPage = (query: any) => request.post<any, GiftResponse>(API.GIFT_PAGE_URL, query)

//新增礼物
export const reqGiftsAdd = (data: any) => request.post<any, R<boolean>>(API.GIFT_ADD_URL, data)

//查询单个礼物
export const reqGiftsOne = (id: any) => request.get<any, R<Gift>>(API.GIFT_ONE_URL + `?id=` + id)

//编辑礼物
export const reqGiftsUpdate = (data: any) => request.post<any, R<boolean>>(API.GIFT_UPDATE_URL, data)

//删除礼物
export const reqGiftsDel = (id: any) => request.delete<any, R<boolean>>(API.GIFT_DEL_URL + `?id=` + id)